﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ScraperEngine
{
    public enum ScraperTypes
    {
        TrackInformation=0,
        Artwork_Album=1,
        Artwork_Artist=2,
        Artwork_Genre=3,
        Artwork_Composer=4, //TODO: Seriously?
        Lyrics=32
    }


    public class Scraper
    {
        string _path;
        string _author;
        string _site;
        int _type;
        int _version_minor;
        int _version_major;
        
        public string Site
        {
            get { return _site; }
            internal set { _site = value; }
        }

        public string Version
        {
            get { return _version_major + "." + _version_minor; }
            internal set
            {
                string[] vals = value.Split('.');
                if (vals.Length != 2)
                {
                    //TODO: Logging?
                }
                else
                {
                    try
                    {
                        _version_major = Convert.ToInt32(vals[0]);
                        _version_minor = Convert.ToInt32(vals[1]);
                    }
                    catch (Exception ex)
                    {
                        //TODO: Logging!
                    }
                }
            }


        }

        public string Path
        {
            get { return _path; }
            internal set { _path = value; }
        }

        public string Author
        {
            get{ return _author;}
            internal set { _author = value; }
        }

        public ScraperTypes Type
        {
            get{ return (ScraperTypes) Enum.ToObject(typeof(ScraperTypes),(uint) _type);}
            internal set { _type = (int) value; }
        }
    }
}
